﻿//-----------------------------------------------------------------------
// <copyright file="SettingsFactory.cs" company="OpenSource">
//     All code is Microsoft Public License (Ms-PL)
// </copyright>
// <history>
// 2013.02  Created         Chris Hand
// </history>
//-----------------------------------------------------------------------
namespace Sample
{
    using OpenSource.TumblrAPI;
    using OpenSource.TumblrAPI.DataObjects;
    using OpenSource.TumblrAPI.Support;

    /// <summary>
    /// In your actual code you would probably read your settings for a config file or something.
    /// I just made the static class to eliminate the noise.
    /// </summary>
    public static class SettingsFactory
    {
        /// <summary>
        /// Create the TumblrSettings for the sample application
        /// </summary>
        /// <returns>The settings that the sample application will use</returns>
        public static TumblrSettings GetSettings()
        {
            // Go to tumblr, and request an API key.  Use it here.
            TumblrSettings settings = TumblrApiFactory.CreateSettings("api key");

            // The console logger is something created for the sample app.  You don't have to use 
            // any logger if you don't want to.
            settings.Log = new ConsoleLogger(LogFlag.All);
            return settings;
        }
    }
}
